package com.boot.web.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author 霜寒 <1621856595@qq.com>
 * @description 资源路径
 * @date 2020/6/22 22:03
 **/

@ConfigurationProperties(prefix = "boot.web.resource")
public class ResourceProperties {

    private String route = "D:/boot_resources/";

    public void setRoute(String route) {
        String s = route.replace("\\", "/");
        if (s.endsWith("/")) {
            this.route = s;
        } else {
            this.route = s + '/';
        }
    }

    public String getRoute() {
        return route;
    }

    public String getSafeOpenRoute() {
        return this.route + "openRoute/";
    }

    public String getSafeClosedRoute() {
        return this.route + "closedRoute/";
    }

}
